<%@ include file="/common/taglibs.jsp"%>
<head>
<script type="text/javascript" src="<c:url value="/scripts/common.js"/>"></script>
<style type="text/css">
#news_list {
	list-style: none;
	font-size:12px;
	padding-left:5px;
}
#news_list li {
	line-height: 27px;
	background:url(/images/list_icon.gif) no-repeat scroll left 11px transparent;
	padding-left:6px;
	overflow: hidden;
    padding-right: 3px;
    
}
#news_list li a {
	color:#5b5b5b;
}

#news_list li a:hover{
	color:#ff8000;
}

</style>

<script type="text/javascript">
$(function() {
	var aNods = $("ul > div");
	aNods.click(function() {
			var aNod = $(this);
			var liNods = aNod.nextAll("li");
			liNods.toggle(400);
		});
})
</script>
</head>

<div>
	<div style="width:180px;min-height:100px; float:left;">
		
		<div style="margin-bottom:10px; border:1px #69f solid;">
			<div style="background:#6699ff;height:30px;line-height:30px;font-size:14px;padding-left:20px;color:#ffffff">
				<fmt:message key="latest.news"/>
			</div>
			<ul id="news_list">
			
		 	</ul>
		</div>
		<jsp:include page="/common/contact_nav.jsp"></jsp:include>
	</div>
	<div style="float:right; width:755px;min-height:402px;">
		<img alt="" src="/images/QQ.png" width="755px">
		<div style="padding-left:15px;line-height:25px;background-image:url(/images/title_bg2.jpg);width:755x;height:25px">
			<fmt:message key="latest.news"/>
		</div>
		<div style="margin-top:10px">
			<div id="news_title" style="font-size:20px;font-weight:bold;text-align:center;line-height:40px;color:#125DAF;">
			${news.title}
			</div>
			<div id="news_time_hits" style="font-size:14px;text-align:center;line-height:30px;color:#7d7d7d;">
			${news.date}
			</div>
			<div style="height:1px;background:#dddddd"></div>
			
			<div id="news_content" style="padding:10px">${news.content}</div>
		</div>
		
	</div>
	
	<script type="text/javascript">
		getLatestNews();
		function getLatestNews(){
		 	var passUrl = '<c:url value="/app/news/index.json"/>';
			var passData = '';
			createAjax(passUrl, passData, resetPageData); 
		}
		
		function resetPageData(data) {
			var obj = eval(data);
			var newsList = obj.newsList;
			for (var i = 0; i < newsList.length; i++) {
				var news = newsList[i];
				var title = news.title;
				if (title.length > 12) 
					title = title.substr(0, 12) + '...';
				var htm = '<li><a onclick="getNewsDetail('+ news.id +')">' + title 
						+ '</a></li>';
				$('#news_list').append(htm);
			}
			
		}
		
		function getNewsDetail(id) {
			var passUrl = '<c:url value="/app/news/newsDetail.json"/>';
			var passData = 'id=' + id;
			createAjax(passUrl, passData, resetNewsData); 
		}
		
		function resetNewsData(data) {
			var obj = eval(data);
			var news = obj.news;
			$('#news_title').html(news.title);
			$('#news_time_hits').html('time:' + news.date + '  Hits:' + news.hits);
			$('#news_content').html(news.content);
		}
		
		
		
	</script>
</div>